package com.fnzn.entranceGuard.mapper.community;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.fnzn.entranceGuard.entity.GuardDevice;
import com.fnzn.entranceGuard.entity.GuardDeviceEntity;
import com.fnzn.entranceGuard.entity.community.CommunityInfo;
import com.fnzn.entranceGuard.entity.sys.SysUserRole;
import com.fnzn.entranceGuard.vo.UnitHouseVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 小区基本信息表 Mapper 接口
 * </p>
 *
 * @author xiaosa
 * @since 2018-06-11
 */
public interface CommunityInfoMapper extends BaseMapper<CommunityInfo> {

    /**
     * 根据当前登录用户id和小区id获取到角色id
     *
     * @param userName,communityId
     * @return list 角色id集合
     */
    List<SysUserRole> getRoleId(@Param("userName")String userName, @Param("communityId")String communityId);

    /**
     * 根据角色id获取到设备集合
     *
     * @param roleId
     * @return list 设备集合
     */
    List<GuardDevice> getDeviceId(String roleId);

    /**
     * 通过楼宇和用户ID  获取房屋信息
     * @param builderId
     * @param username
     * @return
     */
    List<UnitHouseVo> getHouseByBuilderId(@Param("builderId")String builderId, @Param("username")String username);

    /**
     * 通过单元和用户ID  获取房屋信息
     * @param unitId
     * @param username
     * @return
     */
    List<UnitHouseVo> getHouseByUnitId(@Param("unitId")String unitId, @Param("username")String username);

    List<SysUserRole> getRoleIdByCompany(@Param("userName")String userName, @Param("companyId")Integer companyId);
}